Open
Conversation
Deploying syllabus-frontend with
|
| Latest commit: |
58f5625
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6880c555.syllabus-frontend-f3e.pages.dev |
| Branch Preview URL: | https://offline.syllabus-frontend-f3e.pages.dev |
There was a problem hiding this comment.
Pull Request Overview
This pull request adds offline support by introducing a new service worker (sw.js) to cache essential files so that the application remains functional offline. Key changes include the implementation of sw.js with file caching logic, updating the DB version comment in script.js to remind developers to update sw.js when relevant files change, and adding service worker registration code in index.html.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sw.js | New service worker file adds offline caching for essential files. |
| script.js | Updated comment regarding DB version now reminds to update sw.js. |
| index.html | Replaced external Material Icons link with a local version and added inline service worker registration code. |
Files not reviewed (1)
- material-icons.css: Language not supported
| <link rel="icon" href="resources/favicon-utcode.png" /> | ||
| <script> | ||
| if ("serviceWorker" in navigator) { | ||
| navigator.serviceWorker.register("/sw.js"); |
There was a problem hiding this comment.
Consider adding error handling (e.g., using .catch) to the service worker registration to log any registration failures and assist with debugging offline issues.
Suggested change
| navigator.serviceWorker.register("/sw.js"); | |
| navigator.serviceWorker.register("/sw.js").catch((error) => { | |
| console.error("Service worker registration failed:", error); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.